package com.example.propertymangesystem.controller;


import com.example.propertymangesystem.controller.util.R;
import com.example.propertymangesystem.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/categories")
public class categoryController {

    @Autowired
    private ICategoryService categoryService;

    //查询全部
    @GetMapping
    public R getAll() {
        return new R(true, categoryService.list(null));
    }

}
